package com.et114.modules.org.cells;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.extremecomponents.table.bean.Column;
import org.extremecomponents.table.cell.Cell;
import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.util.HtmlBuilder;

import com.et114.modules.org.vo.FunctionVo;

/*
 * @author guanhw
 */
 public class FuncNameHrefCell implements Cell {
	protected  Log logger = LogFactory.getLog( this.getClass ( ) );
	public final static String	SELECTED_PRESIDENTS	= "SELECTED_PRESIDENTS";
	public final static String	SELECTED			= "SELECTED";
	public final static String	UNSELECTED			= "UNSELECTED";

	public String getExportDisplay ( TableModel model , Column column ) {
		return null;
	}

	/**
	 * 
	 */
	public String getHtmlDisplay ( TableModel model , Column column ) {
		HtmlBuilder html = new HtmlBuilder();
		html.td ( 0 ).xclose ( ) ;
		try {
			//
			FunctionVo bean = ( FunctionVo )model.getCurrentRowBean(  );
			html.a ( "javascript:toMod( '" + bean.getFuncId ( ) + "' )"  ) ;
			html.xclose ( );
			html.append ( bean.getFuncChn ( ) ) ;
			html.aEnd ( );			
		} catch ( Exception e ) {
			logger.error (  e.getMessage ( ) , e ) ;
		}
		html.tdEnd ( );
		return html.toString();
	}
}
